const Router = require('koa-router')
const { verifyAuth } = require('../middleware/authMiddleware')

const uploadRouter = new Router({ prefix: '/upload' })
const {
  uploadPicture,
  getPicture
} = require('../controller/uploadController')
const { upload } = require('../middleware/uploadMiddleware')
uploadRouter.post('/:pid', verifyAuth, upload.single('picture'), uploadPicture)
uploadRouter.get('/picture/:path',getPicture)

module.exports = uploadRouter